<template>
  <div class="bg-white rounded-lg p-5 h-full flex flex-col">
    <div>
      <div class="font-bold text-lg mb-4">疫苗运输记录</div>
      <el-form :inline="true" :model="formData" ref="queryForm" size="small">
        <el-form-item prop="vaccineName">
          <el-input v-model="formData.vaccineName" placeholder="疫苗名称"></el-input>
        </el-form-item>
      </el-form>
      <div>
        <el-button type="primary" @click="search">查询</el-button>
        <el-button @click="reset">重置</el-button>
      </div>

      <el-table class="mt-4" :data="dataList" border style="width: 100%">
        <el-table-column type="index" label="序号" width="55" align="center">
        </el-table-column>
        <el-table-column prop="accept" label="接收单位"> </el-table-column>
        <el-table-column prop="vaccineName" label="疫苗名称" >
        </el-table-column>
        <el-table-column prop="vaccineNo" label="批号" >
        </el-table-column>
        <el-table-column prop="product" label="疫苗生产单位" >
        </el-table-column>
        <el-table-column prop="transportName" label="送疫苗人员签名">
        </el-table-column>
        <el-table-column prop="acceptName" label="接收人员签名" >
        </el-table-column>
        <el-table-column prop="acceptTime" label="疫苗接收时间" >
        </el-table-column>
        <el-table-column prop="picUrl" label="疫苗运输冷链记录" >
          <template #default="scope">
            <el-image
              style="width: 50px; height: 50px"
              :src="scope.row.picUrl"
              
            >
            </el-image>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        style="margin-top: 10px; text-align: right"
        :pageSize="formData.pageSize"
        layout="prev, pager, next"
        :page-sizes="[10, 20, 50]"
        :total="total"
        background
        @sizeChange="handleSizeChange"
        @currentChange="handleCurrentChange"
      >
      </el-pagination>
    </div>
    <hr class="mt-auto mb-4" />
    <div class="flex justify-end">
      <el-button type="primary" @click="goBack">返回</el-button>
    </div>
  </div>
</template>

<script>

import { getVaccinesTransportListAPI } from "@/api/zhangping/health-care/prevent-vaccinate";
export default {
  dicts: [
    "enterprise_info_type",
    "health_certificate_status",
    "business_file_status",
    "enterprise_category",
  ],
  data() {
    return {
      formData: {
        pageNum:1,
        pageSize:10,
        vaccineName: null,
      },
      loading: false,
      dataList: [],
      pageSize: 10,
      total: 1000,
    };
  },
  mounted() {
    this.getDataList();
  },
  methods: {
    handleCurrentChange() {},
    handleSizeChange() {},
    reset() {
      this.$refs.queryForm.resetFields();
      this.search()
    },
    async() {},
    search() {
      this.formData.pageNum = 1;
      this.getDataList();
    },
    goBack() {
      this.$router.back();
    },
    getDataList() {
      this.loading = true;

      getVaccinesTransportListAPI(this.formData)
        .then((res) => {
          debugger;
          this.dataList = res.rows;
          this.total = res.total;
        })
        .finally(() => {
          this.loading = false;
        });
    },
  },
};
</script>

<style lang="scss" scoped>


</style>
